<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品表</title>
	<%@ include file="../../include/head.jsp"%>
</head>
<body>
<div class="admin-content">
	<div class="am-g">
		<div class="am-u-sm-12">
			<div class="am-panel-group" id="accordion">
				<div class="am-panel am-panel-default">
					<div class="am-panel-hd">
						<h4 class="am-panel-title" data-am-collapse="{parent: '#accordion', target: '#tab1'}">
							查询条件
						</h4>
					</div>
					<div id="tab1" class="am-panel-collapse am-collapse am-in">
						<div class="am-panel-bd">
							<form id="searchForm" class="am-form-inline" action="${ctx}/cms/commodity/list?categoryId=${page.entity.categoryId}" method="post">
								<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
								<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
								<div class="am-form-group">
									<label>关键字</label>
									<input type="text" name="key" value="${page.key}" class="am-form-field">
								</div>
								<div class="am-form-group">
									<button type="submit" class="am-btn am-btn-success" onclick="initSearchForm()"><i class="am-icon-search"></i> 查询</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="am-panel am-panel-default">
				<div class="am-panel-hd">
					<h4 class="am-panel-title">
						查询列表
						<button type="button" class="am-btn am-btn-primary am-btn-xs iu-right"
								onclick="openModel('新增','${ctx}/cms/commodity/create?categoryId=${page.entity.categoryId}')"><span class="am-icon-plus"></span> 新增
						</button>
					</h4>
				</div>
				<div class="am-panel-collapse am-collapse am-in">
					<div class="am-panel-bd">
						<div class="am-g">
							<div class="am-u-sm-12">
								<table id="contentTable" class="am-table am-table-striped am-table-hover table-main">
									<thead>
									<tr>
										<th>商品货号</th>
										<th>商品名称</th>
										<th>品牌编号</th>
										<th>商品图片</th>
										<th>商品价格</th>
										<th>市场价格</th>
										<th>商品库存</th>
										<th>上架时间</th>
										<th>上市时间</th>
										<th>商品颜色</th>
										<th>是否上架</th>
										<th>是否推荐</th>
										<th>购买次数</th>
										<th>是否新品</th>
										<th>是否热卖</th>
										<th>排序</th>
										<th>商品描述</th>
										<th>修改时间</th>
										<th>备注</th>
										<th>操作</th>
									</tr>
									</thead>
									<tbody>
									<c:forEach items="${page.list}" var="commodity">
										<tr>
											<td>${commodity.sn}</td>
											<td>${commodity.name}</td>
											<td>${commodity.brandId}</td>
											<td>${commodity.img}</td>
											<td>${commodity.price}</td>
											<td>${commodity.market}</td>
											<td>${commodity.amount}</td>
											<td><fmt:formatDate value="${commodity.time}"
																pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td><fmt:formatDate value="${commodity.marketime}"
																pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td>${commodity.colour}</td>
											<td>${commodity.isShop}</td>
											<td>${commodity.isRec}</td>
											<td>${commodity.count}</td>
											<td>${commodity.isNew}</td>
											<td>${commodity.isHot}</td>
											<td>${commodity.sort}</td>
											<td>${commodity.description}</td>
											<td><fmt:formatDate value="${commodity.updateDate}"
																pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td>${commodity.remarks}</td>
											<td>
												<a href="javascript:;" onclick="openModel('编辑','${ctx}/cms/commodity/update?id=${commodity.id}')" title="编辑"><span class="am-icon-pencil"></span></a>
												<a href="${ctx}/cms/commodity/delete?id=${commodity.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}"
																									onclick="return iuConfirm('确认要删除该条数据吗？', this.href)" title="删除"><span class="am-text-danger am-icon-trash-o"></span></a>
											</td>
										</tr>
									</c:forEach>
									</tbody>
								</table>
							</div>
							<div class="am-u-sm-12">
								<%@ include file="../../utils/pagination.jsp" %>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<%@ include file="../../include/bottom.jsp"%>
<script type="text/javascript">
    $(document).ready(function () {
        var msg = '${msg}';
        if(msg!=''){
            iuMsg(msg);
        }
    });
</script>
</body>
</html>

